package at.spengergasse.web.listener;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class SessionListener implements HttpSessionListener {

  private final Log log = LogFactory.getLog(SessionListener.class);

  public void sessionCreated(HttpSessionEvent event) {
    if (log.isDebugEnabled())
      log.debug(new StringBuilder("Session with id ").append(
        event.getSession().getId()).append(" created!").toString());
  }

  public void sessionDestroyed(HttpSessionEvent event) {
    if (log.isDebugEnabled())
      log.debug(new StringBuilder("Session with id ").append(
        event.getSession().getId()).append(" to be destroyed!").toString());
  }
}
